<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>QQ</title>
    <link rel="stylesheet" href="__STATIC__/jquery-weui/dist/lib/weui.css">
    <link rel="stylesheet" href="__STATIC__/jquery-weui/dist/css/jquery-weui.css">
    <script src="__STATIC__/layer_mobile/need/layer.css"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.">
</head>
<style>
    html,body{
        width: 100%;
        height: 100%;
    }

    .layui-m-layercont{
        width: 100%;
        height: 100%;
    }
</style>
<body>
<div style="width: 100%;height: 100%;" class="page">
    <div class="weui-tab">
        <div class="weui-tab__bd">
            <div id="msg" class="weui-tab__bd-item weui-bar__item--on  weui-tab__bd-item--active">
                <div class="weui-search-bar" id="searchBar">
                    <form class="weui-search-bar__form">
                        <div class="weui-search-bar__box">
                            <i class="weui-icon-search"></i>
                            <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" required="">
                            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
                        </div>
                        <label class="weui-search-bar__label" id="searchText">
                            <i class="weui-icon-search"></i>
                            <span>搜索</span>
                        </label>
                    </form>
                    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
                </div>
                <div class="weui-cells"  id="list" style="height: 80%;overflow: scroll">

                    <!--<div class="weui-loadmore">
                        <i class="weui-loading"></i>
                        <span class="weui-loadmore__tips">正在加载</span>
                    </div>-->
                </div>
            </div>
            <div id="group" class="weui-tab__bd-item">
                <div class="weui-cells" id="group-list">
                    <a class="weui-cell weui-cell_access" href="javascript:;">
                        <div class="weui-cell__bd">
                            <p>cell standard</p>
                        </div>
                        <div class="weui-cell__ft">
                        </div>
                    </a>
                </div>
            </div>
            <div id="set" class="weui-tab__bd-item">
                <div>
                    设置
                </div>
            </div>
        </div>

        <div class="weui-tabbar">
            <a href="#msg" class="weui-tabbar__item weui-bar__item--on">
                <span class="weui-badge" style="position: absolute;top: -.4em;right: 1em;">8</span>
                <div class="weui-tabbar__icon">
                    <img src="/copy_QQ/public/images/msg-on.png" alt="">
                </div>
                <p class="weui-tabbar__label">消息</p>
            </a>
            <a href="#group" class="weui-tabbar__item">
                <div class="weui-tabbar__icon">
                    <img src="/copy_QQ/public/images/group-off.png" alt="">
                </div>
                <p class="weui-tabbar__label">联系人</p>
            </a>
            <a href="#set" class="weui-tabbar__item">
                <div class="weui-tabbar__icon">
                    <img src="/copy_QQ/public/images/set-off.png" alt="">
                </div>
                <p class="weui-tabbar__label">设置</p>
            </a>
        </div>
    </div>
</div>

<div hidden>
    <input type="text" id="to">
    <input type="text" id="text">
    <input type="text" id="nickname">
    <button class="weui-btn_primary" id="send">发送</button>
</div>


<script src="__STATIC__/jquery-weui/dist/lib/jquery-2.1.4.js"></script>
<script src="__STATIC__/jquery-weui/dist/js/jquery-weui.js"></script>
<script src="__STATIC__/jquery-weui/dist/js/fastclick.js"></script>
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="__STATIC__/layer_mobile/layer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="/copy_QQ/public/js/im/sdk/json2.js"></script>
<script src="/copy_QQ/public/js/im/sdk/webim.js"></script>
<script src="/copy_QQ/public/js/index/login.js"></script>
<script src="/copy_QQ/public/js/index/sendMsg.js"></script>
<script src="/copy_QQ/public/js/index/addToList.js"></script>
<script src="/copy_QQ/public/js/index/addToGroup.js"></script>
<script src="/copy_QQ/public/js/index/getAccountInfo.js"></script>
<script src="/copy_QQ/public/js/index/showMsg.js"></script>
<script>
    $(function () {
        /*$('.weui-cell_swiped').swipeout();
        var loading=false
        $("#list").infinite(0).on("infinite",function () {
            console.log(loading);
            if(loading){
                return
            }
            setTimeout(function () {
                $(".weui-loadmore").prepend("aaaaaaaa\naaaaaaaa\naaaaaaaa\naaaaaaaa\naaaaaaaa\n");
                loading=false;
            },2000);
        });*/

        $.ajax({
            url:"{:url('api/TlsApi/getUserSig')}",
            type:"post",
            dataType:"json",
            success:function (res) {
                //console.log(res);
                sessionStorage.setItem("userSig",res.usersig);
                sessionStorage.setItem("mobile",res.mobile);
                sessionStorage.setItem("headurl","/copy_QQ/public/images/head/gs ("+Math.round(Math.random()*733+1)+").gif");
                loginIm();//登陆云通讯
            },
            fail:function (res) {
                console.log("网络错误");
            }
        }) ;

        $("#send").on("click",function (e) {
           var to=$("#to").val();
           var text=$("#text").val();
           var tonickname=$("#nickname").val();
            sendMsg({
                "toid":to,
                "text":text,
                "tonickname":tonickname
            });
        });

        $(".weui-tabbar__icon img").on("click",function (e) {
            var src=$(this).attr("src");
            var that=this;
            $(".weui-tabbar__icon img").each(function (index,item) {
                if(this==that){
                    let src=$(that).attr("src");
                    src=src.replace("off","on");
                    $(that).attr("src",src);
                }else{
                    let src=$(item).attr("src");
                    src=src.replace("on","off");
                    $(item).attr("src",src);
                }
            });

        });
    });
</script>
</body>
</html>